money =5000
name=None
name = input("entey your name")
def quary(flag):
    if flag:
        print("--------查询余额----------")
    return money
def cun(num):
    global money
    money+=num
    print("--------存款----------")
    print(f"您存入{num}，余额{quary(False)}")
def qu(num):
    global money
    money-=num
    print("--------取款----------")
    print(f"您取出{num}，余额{quary(False)}")
def main():
    print("--------主菜单----------")
    print(f"{name},欢迎使用AHUT bank")
    print("查询余额\t[输入1]")
    print("存款\t\t[输入2]")
    print("取款\t\t[输入3]")
    print("退出\t\t[输入4]")
while True:

    main()
    key=input("entey key")
    if key=="1":
        yue=quary(True)
        print(f"余额{yue}")
        continue
    elif key=="2":
        quary(False)
        num=int(input("entry cun what"))
        cun(num)
        continue
    elif key=="3":
        quary(False)
        num = int(input("entry qu what"))
        if money-num>0:
           qu(num)
        else:
            print("你没这么多钱")
        continue
    else:
        print("成功退出！")
        break

